from django.db import models

class App(models.Model):
    app_id = models.CharField(blank=False, null=False, unique=True, max_length=60)
    created_at = models.DateTimeField(auto_now_add=True)

    account = models.ForeignKey('Account')
    project = models.ForeignKey('Project')
    
    #last_started = models.BooleanField(default=False)
    #last_ended = models.BooleanField(default=False)
    
    def __str__(self) :return self.app_id

class Account(models.Model):
    email = models.EmailField(blank=False, null=False, unique=True)
    password = models.CharField(blank=False, null=False, max_length=20)
    phone_num = models.CharField(max_length=20)
    
    def __str__(self) :return self.email

class Project(models.Model):
    name = models.CharField(blank=False, null=False, unique=True, max_length=60)
    path = models.CharField(blank=False, null=False, unique=True, max_length=100)
    
    def __str__(self) :return self.name
